export default function answerInitPercentage(
  tradeCabinetonLine,
  fullCabinetonLine,
  chargingPileonLine
) {
  console.log(
    "tradeCabinetonLine, fullCabinetonLine, chargingPileonLine==",
    tradeCabinetonLine,
    fullCabinetonLine,
    chargingPileonLine
  );
  let total = tradeCabinetonLine + fullCabinetonLine + chargingPileonLine;
  var num1 = "";
  var num2 = "";
  var num3 = "";
  num1 =
    fullCabinetonLine <= 0
      ? "0%"
      : Math.round((fullCabinetonLine / total) * 10000) / 100.0 + "%";
  num2 =
    tradeCabinetonLine <= 0
      ? "0%"
      : Math.round((tradeCabinetonLine / total) * 10000) / 100.0 + "%";
  num3 =
    chargingPileonLine <= 0
      ? "0%"
      : Math.round((chargingPileonLine / total) * 10000) / 100.0 + "%";

  document.getElementById("tankBgc").style.width = num1; // 充电柜
  document.getElementById("electricBgc").style.width = num2; // 换电柜
  document.getElementById("pileBgc").style.width = num3; // 充电桩

  let electricBgc = `换电柜${num2}`;
  let tankBgc = `充电柜${num1}`;
  let pileBgc = `充电桩${num3}`;
  return { electricBgc, tankBgc, pileBgc };
}
